package com.example.a2205douyin;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.ScrollView;

public class DiyScrollView extends ScrollView {
    public DiyScrollView(Context context) {
        super(context);
    }

    public DiyScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public DiyScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public DiyScrollView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    /**
     * 分发
     * @param ev The motion event to be dispatched.
     * @return
     */
    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.d("sss", "dispatchTouchEvent: "+super.dispatchTouchEvent(ev));
        return super.dispatchTouchEvent(ev);
    }

    /**
     * 拦截
     * @param ev The motion event being dispatched down the hierarchy.
     * @return
     */
    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        Log.d("sss", "onInterceptTouchEvent: "+super.onInterceptTouchEvent(ev));
        /*return super.onInterceptTouchEvent(ev);*/
        return false;
    }

    /**
     * 点击事件
     * @param ev The motion event.
     * @return
     */
    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        Log.d("sss", "onTouchEvent: "+super.onTouchEvent(ev));
        return super.onTouchEvent(ev);
    }
}
